Optimal. Leaf size=169 \[ \frac{(A b-2 a B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{a^{3/2} d}+\frac{(B+i A) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a-i b}}\right )}{d \sqrt{a-i b}}-\frac{(-B+i A) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a+i b}}\right )}{d \sqrt{a+i b}}-\frac{A \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{a d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.512888, antiderivative size = 169, normalized size of antiderivative = 1., number of steps used = 12, number of rules used = 7, integrand size = 33, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.212, Rules used = {3609, 3653, 3539, 3537, 63, 208, 3634} \[ \frac{(A b-2 a B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{a^{3/2} d}+\frac{(B+i A) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a-i b}}\right )}{d \sqrt{a-i b}}-\frac{(-B+i A) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a+i b}}\right )}{d \sqrt{a+i b}}-\frac{A \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{a d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3609
Rule 3653
Rule 3539
Rule 3537
Rule 63
Rule 208
Rule 3634
Rubi steps
\begin{align*} \int \frac{\cot ^2(c+d x) (A+B \tan (c+d x))}{\sqrt{a+b \tan (c+d x)}} \, dx &=-\frac{A \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{a d}-\frac{\int \frac{\cot (c+d x) \left (\frac{1}{2} (A b-2 a B)+a A \tan (c+d x)+\frac{1}{2} A b \tan ^2(c+d x)\right )}{\sqrt{a+b \tan (c+d x)}} \, dx}{a}\\ &=-\frac{A \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{a d}-\frac{\int \frac{a A+a B \tan (c+d x)}{\sqrt{a+b \tan (c+d x)}} \, dx}{a}-\frac{(A b-2 a B) \int \frac{\cot (c+d x) \left (1+\tan ^2(c+d x)\right )}{\sqrt{a+b \tan (c+d x)}} \, dx}{2 a}\\ &=-\frac{A \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{a d}-\frac{1}{2} (A-i B) \int \frac{1+i \tan (c+d x)}{\sqrt{a+b \tan (c+d x)}} \, dx-\frac{1}{2} (A+i B) \int \frac{1-i \tan (c+d x)}{\sqrt{a+b \tan (c+d x)}} \, dx-\frac{(A b-2 a B) \operatorname{Subst}\left (\int \frac{1}{x \sqrt{a+b x}} \, dx,x,\tan (c+d x)\right )}{2 a d}\\ &=-\frac{A \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{a d}+\frac{(i A-B) \operatorname{Subst}\left (\int \frac{1}{(-1+x) \sqrt{a+i b x}} \, dx,x,-i \tan (c+d x)\right )}{2 d}-\frac{(i A+B) \operatorname{Subst}\left (\int \frac{1}{(-1+x) \sqrt{a-i b x}} \, dx,x,i \tan (c+d x)\right )}{2 d}-\frac{(A b-2 a B) \operatorname{Subst}\left (\int \frac{1}{-\frac{a}{b}+\frac{x^2}{b}} \, dx,x,\sqrt{a+b \tan (c+d x)}\right )}{a b d}\\ &=\frac{(A b-2 a B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{a^{3/2} d}-\frac{A \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{a d}+\frac{(A-i B) \operatorname{Subst}\left (\int \frac{1}{-1-\frac{i a}{b}+\frac{i x^2}{b}} \, dx,x,\sqrt{a+b \tan (c+d x)}\right )}{b d}+\frac{(A+i B) \operatorname{Subst}\left (\int \frac{1}{-1+\frac{i a}{b}-\frac{i x^2}{b}} \, dx,x,\sqrt{a+b \tan (c+d x)}\right )}{b d}\\ &=\frac{(A b-2 a B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{a^{3/2} d}+\frac{(i A+B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a-i b}}\right )}{\sqrt{a-i b} d}-\frac{(i A-B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a+i b}}\right )}{\sqrt{a+i b} d}-\frac{A \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{a d}\\ \end{align*}
Mathematica [A] time = 2.80508, size = 201, normalized size = 1.19 \[ \frac{\frac{b (A b-2 a B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{a^{3/2}}+\frac{\left (A \sqrt{-b^2}+b B\right ) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a-\sqrt{-b^2}}}\right )}{\sqrt{a-\sqrt{-b^2}}}-\frac{\left (A \sqrt{-b^2}-b B\right ) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a+\sqrt{-b^2}}}\right )}{\sqrt{a+\sqrt{-b^2}}}-\frac{A b \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{a}}{b d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] time = 1.607, size = 69579, normalized size = 411.7 \begin{align*} \text{output too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (A + B \tan{\left (c + d x \right )}\right ) \cot ^{2}{\left (c + d x \right )}}{\sqrt{a + b \tan{\left (c + d x \right )}}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (B \tan \left (d x + c\right ) + A\right )} \cot \left (d x + c\right )^{2}}{\sqrt{b \tan \left (d x + c\right ) + a}}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]